<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" placeholder="请输入1-100之间的整数">
<input type="button" value="猜一猜" onclick="fn()">
<h1></h1>
<!---->
<script src="../jq.js"></script>
<script>
    //得到1-100之间的随机数
    let x = parseInt(Math.random()*100+1);
    function fn() {
        if ($("input:first").val() > x){
            $("h1").text("猜对了！")
        }else if($("input:first").val()<x){
            $("h1").text("猜小了！")
        }else{
            $("h1").text("恭喜你猜对了！")
        }
    }
</script>
</body>
</html>